<%@ page language="java" contentType="text/html; charset=UTF-8"   pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta charset="UTF-8">
	<title>用户中心</title>
	<script type="text/javascript" src="/static/js/jquery-1.10.2.min.js"></script>
	<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
</head>
<body>

<script type="text/javascript">
 	var baseUrl = "http://127.0.0.1:8080/phoenix-apps-cms";
 
 	var hostName = window.location.hostname;
 	function getOneCustomizePic(id){
 		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/getOneCustomizePic/"+id,
 			type:'GET',
 			success:function(v){
 				$("#show").text("IdxCustomizePic [id=" + v.id + ", picUrl=" + v.picUrl
 							+ ", picHref=" + v.picHref + ", picAlt=" + v.picAlt + ", status="
 							+ v.status + ", onlineTime=" + v.onlineTime + ", offlineTime="
 							+ v.offlineTime + ", createTime=" + v.createTime + ", updateTime="
 							+ v.updateTime + "]");
 			}
 		})
 	}
	function showcmsCustomizePicPersist(){
 		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/getAllCustomizePicByOrder",
 			type:'POST',
 			data:{pageSize:25,pageNo:1},
 			success:function(res){
 				$("#show").text("");
 				$.each(res.items,function(i,v){
 					$("#show").append("IdxCustomizePic [id=" + v.id + ", picUrl=" + v.picUrl
 							+ ", picHref=" + v.picHref + ", picAlt=" + v.picAlt + ", status="
 							+ v.status + ", onlineTime=" + v.onlineTime + ", offlineTime="
 							+ v.offlineTime + ", createTime=" + v.createTime + ", updateTime="
 							+ v.updateTime + "]<br/>")
 				}) 
 			}
 		})
 	}
	function insertcmsCustomizePicPersist(){
		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/addOneCustomizePic",
 			type:'POST',
 			data:{picUrl:"xxx",status:2,offlineTime:new Date(111111111),onlineTime:new Date(111111111)},
 			success:function(res){
 				$("#show").text("success");
 			},error:function(e1,e2){
 				$("#show").text(e2);
 				$("#show").append(e1.responseText);
 			}
 		})
 	}
	function updatecmsCustomizePicPersist(){
		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/updateOneCustomizePic",
 			type:'POST',
 			data:{id:1, picUrl:"/static/images/order.jpg", picHref:"http://www.baidu.com1", picAlt:"这个图片啊啊啊啊BBB", status:2, onlineTime:new Date(143012476), offlineTime:new Date(143012476), createTime:new Date(143018563), updateTime:new Date(143018564)},
 			success:function(res){
 				$("#show").text(res.msg);
 			}
 		})
 	}
	function updatecmsCustomizePicStatusPersist(picId,status){
		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/updatePicCustomizePicStatus",
 			type:'POST',
 			data:{picId:picId,status:status},
 			success:function(res){
 				$("#show").text(res.msg);
 			}
 		})
 	}
	function updatecmsCustomizePicListStatusPersist(picIds,status){
		$.ajax({
 			url:baseUrl+"/cmsCustomizePic/updatePicCustomizePicStatusList",
 			type:'POST',
 			data:{picIds:picIds,status:status},
 			success:function(res){
 				$("#show").text(res.msg);
 			}
 		})
 	}
	
 </script>
<button onclick="getOneCustomizePic(1)">show1测试</button><br>
<button onclick="showcmsCustomizePicPersist()">show测试</button><br>
<button onclick="insertcmsCustomizePicPersist()">insert测试</button><br>
<button onclick="updatecmsCustomizePicPersist(2)">updatecmsCustomizePic测试</button><br>
<button onclick="updatecmsCustomizePicStatusPersist(2,3)">updateStatus测试</button><br>
<button onclick="updatecmsCustomizePicListStatusPersist('2,3',1)">updateListStatus测试</button><br>
查询结果:<div id="show"></div>

</body>
</html>